import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import echarts from 'echarts'
import china from 'echarts/map/json/china.json'
import 'element-ui/lib/theme-chalk/index.css';
import request from "./api/http.js";

Vue.use(ElementUI);

Vue.config.productionTip = false
Vue.prototype.request = request;
Vue.prototype.$echarts = echarts;

echarts.registerMap('china', china);

// 根据路由设置标题
router.beforeEach((to, from, next) => {
  /*路由发生改变修改页面的title */
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next();
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
